/*=============== GOOGLE FONTS ===============*/
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap');

/*=============== VARIABLES CSS ===============*/
:root {
  --header-height: 3.5rem;

  /*========== Colors ==========*/
  /*Color mode HSL(hue, saturation, lightness)*/
  --primary-green : #00796B;
  --darker-green : #00534a;
  --black-color: hsl(220, 24%, 12%);
  --black-color-light: hsl(220, 24%, 15%);
  --black-color-lighten: hsl(220, 20%, 18%);
  --gray: #A6A6A6;
  --white-color: #fff;
  --white-color-dark: hsl(0, 0%, 93%);
  --body-color: hsl(220, 100%, 97%);

  /*========== Font and typography ==========*/
  /*.5rem = 8px | 1rem = 16px ...*/
  --body-font: "Poppins", sans-serif;
  --normal-font-size: .938rem;

  /*========== Font weight ==========*/
  --font-regular: 200;
  --font-semi-bold: 350;

  /*========== z index ==========*/
  --z-tooltip: 10;
  --z-fixed: 100;
}

/*========== Responsive typography ==========*/
@media screen and (min-width: 1024px) {
  :root {
    --normal-font-size: 1rem;
  }
}

/*=============== BASE ===============*/
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}


body {
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  background-color: var(--white-color);
}

ul {
  list-style: none;
  /* Color highlighting when pressed on mobile devices */
  -webkit-tap-highlight-color: transparent;
}

a {
  text-decoration: none;
}

/*=============== REUSABLE CSS CLASSES ===============*/
.container {
  max-width: 1250px;
  margin-inline: 1.5rem;
}

/*=============== HEADER ===============*/
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--white-color);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  z-index: var(--z-fixed);
}

/*=============== NAV ===============*/
.nav {
  height: var(--header-height);
}

.nav__logo, 
.nav__burger, 
.nav__close {
  color: var(--black-color);
}

.nav__data {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;  
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  column-gap: .50rem;
  font-weight: var(--font-semi-bold);
  /* Color highlighting when pressed on mobile devices */
  -webkit-tap-highlight-color: transparent;
}

.nav__logo i {
  font-weight: initial;
  font-size: 1.25rem;
}

.nav__toggle {
  position: relative;
  width: 32px;
  height: 32px;
}

.nav__burger, 
.nav__close {
  position: absolute;
  width: max-content;
  height: max-content;
  inset: 0;
  margin: auto;
  font-size: 1.25rem;
  cursor: pointer;
  transition: opacity .1s, transform .4s;
}

.nav__close {
  opacity: 0;
}

/* Navigation for mobile devices */
@media screen and (max-width: 1118px) {
  .nav__menu {
    position: absolute;
    left: 0;
    top: 2.5rem;
    width: 100%;
    height: calc(100vh - 3.5rem);
    overflow: auto;
    pointer-events: none;
    opacity: 0;
    transition: top .4s, opacity .3s;
  }
  .nav__menu::-webkit-scrollbar {
    width: 0;
  }
  .nav__list {
    background-color: var(--white-color);
    padding-top: 1rem;
  }
}

.nav__link {
  color: var(--black-color);
  background-color: var(--white-color);
  font-weight: var(--font-semi-bold);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color .3s;
}

.nav__link:hover {
  background-color: var(--white-color-dark);
}

/* Show menu */
.show-menu {
  opacity: 1;
  top: 3.5rem;
  pointer-events: initial;
}

/* Show icon */
.show-icon .nav__burger {
  opacity: 0;
  transform: rotate(90deg);
}
.show-icon .nav__close {
  opacity: 1;
  transform: rotate(90deg);
}

/*=============== DROPDOWN ===============*/
.dropdown__item {
  cursor: pointer;
}

.dropdown__arrow {
  font-size: 1.25rem;
  font-weight: initial;
  transition: transform .4s;
}

.dropdown__link, 
.dropdown__sublink {
  padding: 1.25rem 1.25rem 1.25rem 2.5rem;
  color: var(--black-color);
  background-color: var(--white-color);
  display: flex;
  align-items: center;
  column-gap: .5rem;
  font-weight: var(--font-semi-bold);
  transition: background-color .3s;
}

.dropdown__link i, 
.dropdown__sublink i {
  font-size: 1.25rem;
  font-weight: initial;
}

.dropdown__link:hover, 
.dropdown__sublink:hover {
  background-color: var(--white-color-dark);
}

.dropdown__menu, 
.dropdown__submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease-out;
}

/* Show dropdown menu & submenu */
.dropdown__item:hover .dropdown__menu, 
.dropdown__subitem:hover > .dropdown__submenu {
  max-height: 1000px;
  transition: max-height .4s ease-in;
}

/* Rotate dropdown icon */
.dropdown__item:hover .dropdown__arrow {
  transform: rotate(180deg);
}

/*=============== DROPDOWN SUBMENU ===============*/
.dropdown__add {
  margin-left: auto;
}

.dropdown__sublink {
  background-color: var(--white-color);
}

/*=============== BREAKPOINTS ===============*/
/* For small devices */
@media screen and (max-width: 340px) {
  .container {
    margin-inline: 1rem;
  }

  .nav__link {
    padding-inline: 1rem;
  }
}

/* For large devices */
@media screen and (min-width: 1118px) {
  .container {
    margin-inline: auto;
  }

  .nav {
    height: calc(var(--header-height) + 2rem);
    display: flex;
    justify-content: space-between;
  }
  .nav__toggle {
    display: none;
  }
  .nav__list {
    height: 100%;
    display: flex;
    column-gap: 3rem;
  }
  .nav__link {
    height: 100%;
    padding: 0;
    justify-content: initial;
    column-gap: .25rem;
  }
  .nav__link:hover {
    background-color: transparent;
  }

  .dropdown__item, 
  .dropdown__subitem {
    position: relative;
  }

  .dropdown__menu, 
  .dropdown__submenu {
    max-height: initial;
    overflow: initial;
    position: absolute;
    left: 0;
    top: 6rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s, top .3s;
  }

  .dropdown__link, 
  .dropdown__sublink {
    padding-inline: 1rem 3.5rem;
  }

  .dropdown__subitem .dropdown__link {
    padding-inline: 1rem;
  }

  .dropdown__submenu {
    position: absolute;
    left: 100%;
    top: .5rem;
  }

  /* Show dropdown menu */
  .dropdown__item:hover .dropdown__menu {
    opacity: 1;
    top: 5.5rem;
    pointer-events: initial;
    transition: top .3s;
  }

  /* Show dropdown submenu */
  .dropdown__subitem:hover > .dropdown__submenu {
    opacity: 1;
    top: 0;
    pointer-events: initial;
    transition: top .3s;
  }
}

/*=============== OUR IMPACT SECTION ===============*/
.our_impact_section {
    width: 100%;
    overflow: hidden;
}

.our-impact {
    position: relative;
    padding: clamp(10rem, 8vw, 11.5rem) clamp(2rem, 10vw, 12.5rem) clamp(1rem, 5vw, 3.125rem) clamp(2rem, 10vw, 12.5rem);
}

.our-impact h2 {
    font-size: clamp(1.5rem, 5vw, 3rem);
    color: var(--primary-green, #00A28A);
    margin-bottom: clamp(1rem, 3vw, 2.5rem);
    text-align: center;
}

.stats-row {
    display: flex;
    justify-content: center; /* Changed from space-between to center */
    gap: clamp(0.5rem, 2vw, 1.5rem);
    text-align: center; /* Ensure text alignment is centered */
    margin-bottom: clamp(7.5rem, 5vw, 8rem);
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center; /* Changed from flex-start to center */
    text-align: center; /* Changed from left to center */
    flex: 1;
    min-width: 120px; /* Reduced from 150px for better small-screen behavior */
    padding: 0 2rem; /* Added padding for spacing */
}

.stat .overline {
    font-size: clamp(2rem, 10vw, 8rem);
    line-height: 0.9;
    margin-bottom: clamp(-4.5rem, -8vw, -5rem);
    color: var(--black-color, #000);
}

.stat .number {
    font-size: clamp(1.5rem, 6vw, 4rem);
    font-weight: 500;
    color: var(--black-color, #000);
    margin-bottom: clamp(-0.5rem, -1vw, -0.625rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat .label {
    font-size: clamp(0.875rem, 2.5vw, 1.5rem);
    color: var(--black-color, #000);
    text-transform: lowercase;
}

.stat i{
    font-size:clamp(1.5rem, 6vw, 4rem) ;
}

/* Pie chart styling */
.pie-chart-container {
    max-width: 400px;
    margin: 0 auto clamp(7.5rem, 5vw, 8rem) auto;
    position: relative;
}

/*=============== MEDIA QUERIES ===============*/
@media screen and (max-width: 1000px) {
    .our-impact {
        padding: clamp(1.5rem, 6vw, 6rem) clamp(1.5rem, 8vw, 9.375rem);
    }
    .stats-row {
        justify-content: center;
        gap: clamp(1rem, 3vw, 2rem);
    }
    .stat {
        width: 45%;
        margin-bottom: clamp(1rem, 2vw, 1.5rem);
    }
}

@media screen and (max-width: 900px) {
    .our-impact {
        padding: clamp(1rem, 5vw, 3rem) clamp(1rem, 5vw, 3rem);
    }
    .stats-row {
        flex-direction: column;
        align-items: center;
        gap: clamp(1rem, 3vw, 1.5rem);
    }
    .stat {
        width: 100%;
        align-items: center;
        text-align: center;
    }
    .stat .overline {
        margin-bottom: clamp(-1.5rem, -6vw, -3.75rem);
    }
}

@media screen and (max-width: 1024px) {
    .stat .number {
        font-size: clamp(1.1rem, 4.5vw, 2rem);
    }
}

@media screen and (max-width: 767px) {
    .stats-row {
        flex-direction: column;
        gap: clamp(0.75rem, 3.5vw, 1.25rem);
    }
    .stat {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
        align-items: center;
        text-align: center;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    .number {
        white-space: normal;
        text-overflow: clip;
    }
}

@media screen and (max-width: 480px) {
    .our-impact h2 {
        font-size: clamp(1.25rem, 6vw, 2rem);
        margin-bottom: clamp(0.75rem, 2vw, 1.5rem);
    }
    .stat {
      height: 50vh;
    }
    .stat .overline {
        font-size: clamp(1.5rem, 8vw, 4rem);
        margin-bottom: 0.2rem;
    }
    .stat .number {
        font-size: clamp(1.25rem, 6vw, 3rem);
    }
    .stat .label {
        font-size: clamp(0.75rem, 3.5vw, 1rem);
    }
    .pie-chart {
        width: 300px;
        height: 300px;
    }
    .pie-slice::after {
        font-size: clamp(0.65rem, 1.8vw, 0.9rem);
        top: -30px;
        padding: 3px 8px;
    }
}

/*=============== FILTER SECTION ===============*/
.section {
    padding: 30px 200px 40px 200px;
  }
  
  .container {
    max-width: 1250px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .filters {
    box-sizing: border-box;
    width: 100%;
    min-width: 0px;
    max-width: 1100px;
    flex: 0 0 auto;
    margin-bottom: 2rem;
    background-color: var(--white-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.25);
    min-width: 0;
  }
  
  .filter-content {
    display: grid;
    grid-template-columns: repeat(3, 1.5fr);
    align-items: start;
    box-sizing: border-box;
    gap: 1rem;
  }
  
  .filter-item {
    display: flex;
    flex-direction: column;
  }
  
  .filter-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-green);
    margin-bottom: 0.25rem;
  }
  
  .filter-input {
    padding: 0.75rem;
    border: 1px solid var(--primary-green);
    border-radius: 0.5rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    width: 100%;
  }
  
  .filter-input:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 2px rgba(0, 162, 138, 0.2);
  }

/*=============== GRANTS SECTION ===============*/
/* Grants Section Styling */
.content_grants {
    padding: 5rem 0.8rem;
}

.grants_card_container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    justify-content: center;}

.grants_card {
    background: white;
    border: 2px solid var(--primary-green);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    max-height: 500px;
    margin-bottom: 2rem;
    justify-content: center;
}

.grants_card a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 2rem;
}

.grants_card h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-green);
    margin-bottom: 0.5rem;
    text-align: center;
}

.dept {
    font-size: 0.9rem;
    color: black;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.info-row{
    margin-bottom: 0.5rem;
}

.info-row i {
    color: var(--primary-green);
    margin-right: 0.5rem;
    margin-bottom: 1rem;
}

.info-row strong {
    color: var(--primary-green);
    margin-right: 0.25rem;
}

.funding-pill {
    background: var(--primary-green);
    color: white;
    padding: 0.8rem 1.2rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    margin-top: 1rem;
    display: block; /* Change to block to enable margin auto */
    width: fit-content; /* Ensures it only takes the width of its content */
    margin-left: auto; /* Centers horizontally */
    margin-right: auto; /* Centers horizontally */
    align-self: auto; /* Remove flex-end alignment */
}

/* Hover Effect */
.grants_card:hover {
    transform: translateY(-10px);
}

/* Responsive Adjustments */
@media (max-width: 1450px) and (min-width: 1350px) {
    .grants_card_container {
        grid-template-columns: repeat(3, minmax(280px, 1fr)); /* Max 3 cards per row */
    }
    .grants_card h2 {
        font-size: 1.1rem;
    }

    .dept {
        font-size: 0.8rem;
    }

    .info-row {
        font-size: 0.8rem;
    }

    .funding-pill {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 1349px) and (min-width: 768px) {
    .grants_card_container {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Flexible, up to 3 */
    }
    .grants_card h2 {
        font-size: 1.1rem;
    }

    .dept {
        font-size: 0.7rem;
    }

    .info-row {
        font-size: 0.7rem;
    }

    .funding-pill {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 767px) and (min-width: 480px) {
    .grants_card_container {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Flexible, up to 2 */
    }
    .grants_card h2 {
        font-size: 1.1rem;
    }

    .dept {
        font-size: 0.7rem;
    }

    .info-row {
        font-size: 0.7rem;
    }

    .funding-pill {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 479px) {
  .our_impact_section {
    margin-top: calc(var(--header-height) + 1rem);
  }
  .stats-row {
    margin-bottom: 0;
  }
  .stats-row.pie-chart-container {
    justify-content: flex-start;
    margin-bottom: 1rem;
  }
    section.section {
      width: 100%;
      padding: 30px 0 40px;
    }
    section.section .container {
      width: 80vw;
      justify-self: center;
      margin: 0;
    }
    .filter-content {
      grid-template-columns: repeat(1, 1.5fr);
    }
    .grants_card_container {
        grid-template-columns: 1fr; /* Single column */
    }
    .grants_card a {
      padding: 1.5rem;
    }

    .grants_card h2 {
        font-size: 0.95rem;
    }

    .dept {
        font-size: 0.75rem;
    }

    .info-row {
        font-size: 0.65rem;
    }

    .funding-pill {
        font-size: 0.65rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Pagination Styles */
.pagination {
  display: flex;
  justify-content: center;
  padding-bottom: 3rem;
  padding-top: 4rem;
}

.pagination a {
  color: #004d40;
  padding: 8px 16px;
  text-decoration: none;
  border: 1px solid #ddd;
  margin: 0 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.pagination a.active {
  background-color: #004d40;
  color: white;
  border: 1px solid #004d40;
}

.pagination a:hover:not(.active) {
  background-color: #ddd;
}

.pagination a.disabled {
  color: #ccc;
  cursor: not-allowed;
}

/*=============== CONTACT US ===============*/
.contact_us {
  width: 100%;
  background: linear-gradient(to bottom, #00796B, #05897A);
  color: var(--white-color);
  padding: 40px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.contact_content {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
}

.contact_content h1 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.contact_content h2 {
  font-size: 1.2rem;
  margin: 30px 50px;
  font-weight: 300;
}

.contact_content h3 {
  font-size: 1.2rem;
  margin: 10px 0;
  font-weight: 300;
}

.contact_content h3 strong {
  font-weight: 700;
}

.divider {
  width: 1000px;
  height: 1px;
  background: var(--white-color);
  border: none;
  margin: 40px auto;
}

.social_icons {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 30px;
}

.social_icons a {
  color: var(--white-color);
  font-size: 2rem;
  transition: color 0.3s ease, transform 0.3s ease;
}

@media (hover: hover) {
  .social_icons a:hover {
    color: var(--gray);
    transform: scale(1.1);
  }
}

.footer_nav {
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.footer_nav a {
  color: var(--white-color);
  text-decoration: none;
  margin: 0 5px;
  transition: color 0.3s ease;
}

@media (hover: hover) {
  .footer_nav a:hover {
    color: var(--gray);
  }
}

.copyright {
  font-size: 0.8rem;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
  .partners_and_collaborators {
    padding: 20px 0;
    margin-bottom: 80px;
  }

  .partners_and_collaborators .title_header {
    margin-top: 2rem;
    padding: 1.5rem 0;
  }

  .partners_and_collaborators .highlight-header {
    width: clamp(100px, 25vw, 150px);
    margin: -1.5rem auto 1.5rem;
  }

  .logo-track img {
    height: 40px;
    margin: 0 10px;
  }

  .contact_us {
    padding: 40px 0;
    height: clamp(550px, 90vh, 600px);
  }

  .contact_content h1 {
    font-size: 1.5rem;
  }

  .contact_content h2 {
    font-size: 1rem;
    margin: 20px 30px;
  }

  .contact_content h3 {
    font-size: 1rem;
  }

  .divider {
    width: 100%;
  }

  .social_icons {
    gap: 20px;
  }

  .social_icons a {
    font-size: 1.3rem;
  }

  .footer_nav {
    font-size: 0.8rem;
  }

  .copyright {
    font-size: 0.7rem;
  }
}